import request from '@/utils/request';

/**
 * 详情
 *
 * @param id
 * @returns Promise
 *
 * @todo 发起axios请求
 */
export const getSystemKvDetail = (keyname: 'system_charge' | 'system_plan') => {
  return request({
    url: `/admin/kv/${keyname}`,
    method: 'get'
  });
};

/**
 * 编辑
 *
 * @param id
 * @param data
 * @returns Promise
 *
 * @todo 发起axios请求
 */
export const updateSystemKv = (
  keyname: string,
  data: API.systemKv.EntityDto
) => {
  return request({
    url: `/admin/kv/${keyname}`,
    method: 'put',
    data
  });
};
